package com.xunai.saas.example.controller;

import com.xunai.saas.example.model.param.AddPatientParam;
import com.xunai.saas.example.model.param.IntelligentConsultationNextParam;
import com.xunai.saas.example.model.param.IntelligentConsultationStart;
import com.xunai.saas.example.service.IntelligentConsultationService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 中医智能辩证示例接口
 *
 * @author Admin
 */
@RequestMapping("/intelligentConsultationApi")
@RestController
public class IntelligentConsultationApiExample {

    @Resource
    IntelligentConsultationService intelligentConsultationService;

    /***
     * 新增患者信息
     * @param addPatientParam
     * @return
     */
    @PostMapping("/addPatient")
    public String addPatient(@RequestBody AddPatientParam addPatientParam) {

        return intelligentConsultationService.addPatient(addPatientParam);
    }

    /***
     * 获取所有科室
     * @return
     */
    @GetMapping("/getDepartmentList")
    public String getDepartmentList() {
        return intelligentConsultationService.getDepartmentList();
    }

    /***
     * 开始问诊
     * @param intelligentConsultationStart
     * @return
     */
    @PostMapping("/start")
    public String start(@RequestBody IntelligentConsultationStart intelligentConsultationStart) {
        return intelligentConsultationService.start(intelligentConsultationStart);
    }

    /***
     * 获取问题主症
     * @param recordId
     * @return
     */
    @GetMapping("/getMainSymptomAll")
    public String getMainSymptomAll(@RequestParam("recordId") Integer recordId) {
        return intelligentConsultationService.getMainSymptomAll(recordId);
    }

    /***
     * 提交答案
     * @param intelligentConsultationNextParam
     * @return
     */
    @PostMapping("/next")
    public String next(@RequestBody IntelligentConsultationNextParam intelligentConsultationNextParam){
        return intelligentConsultationService.next(intelligentConsultationNextParam);
    }

    /***
     * 获取辨证结果详情
     * @param recordId
     * @return
     */
    @GetMapping("/detail")
    public String detail(@RequestParam("recordId") Integer recordId){
        return intelligentConsultationService.detail(recordId);
    }
}
